package com.example.test.advice.第六章_枚举和注解.建议84_使用构造函数协助描述枚举项;

public enum Role {

    Admin("管理员",new Lifetime(),new Scope()),User("普通用户",new Lifetime(),new Scope());

    //中文描述
    private String name;

    //角色生命周期
    private Lifetime lifetime;

    //权限范围
    private Scope scope;

    Role(String name, Lifetime lifetime, Scope scope) {
        this.name = name;
        this.lifetime = lifetime;
        this.scope = scope;
    }

    public String getName() {
        return name;
    }

    public Lifetime getLifetime() {
        return lifetime;
    }

    public Scope getScope() {
        return scope;
    }
}
